<?php

class RecComment {

	//public $comment

	function __construct() {
		//$this->auth = new UserAccount;
		$this->error_str = '';
	}

	public function InitFromFieldArray($comment) {
		$this->comment = $comment;
	}

	// Maybe this function wants to be static...?
	public function InitFromKey($recID, $commentNumber) {
		global $dbobj;
		
		$comment_ar = $dbobj->GetResultsAsNestedArray("SELECT * FROM mr_recComment WHERE recID = " . $recID . " AND commentNumber = " . $commentNumber . "", 1);
		$comment_r = $comment_ar[0];
		//$ncmt = new RecComment(); // does this line have a use?
		$this->comment = $comment_r;
	}



	public function RemoveRecComment() {
		global $dbobj;

		$dbobj->SendQuery("UPDATE mr_recComment SET disabled = 1 WHERE recID = " . $this->comment['recID'] . " AND commentNumber = " . $this->comment['commentNumber'] . "");

		return true;
	}


	public static function CommentFormat($entry_text) {
		require_once('inc_texttohtml.php');

		return TextToHtml::GetHtml($entry_text, true, false);
	}

}

?>